﻿import gs.TweenLite;
import mx.utils.Delegate;
class cn.eminia.AS2.BoE {
	// Btn od Effect
	function BoE(btn, act, obj) { 
		if (btn.real != null) btn.hitArea= btn.real;
		btn.real._alpha=0;
		
		var scope=(obj.scope==null)?btn:obj.scope;
		
		
		if(obj.over!=null){ 
			btn._onRollOver=Delegate.create(scope,obj.over);
		}
		if(obj.out!=null){
			btn._onRollOut=Delegate.create(scope,obj.out);
		}
		btn.onRollOver = function() {
			this._onRollOver();
			this.gotoAndPlay('s1');
			//showClue1
		};
		btn.onRollOut = btn.onReleaseOutside=function () {
			this._onRollOut();
			this.gotoAndPlay('s2');
		}; 
		/*btn.onPress=function(){
			this._x+=1;			
			this._y+=1;
		}*/
		btn.onRelease = (act == undefined) ? null : Delegate.create(scope, act);
		
		//附加属性
		if (obj != undefined) {
			for (var i in obj) {
				btn[i] = obj[i];
			}
		}
	}
}